//
//  MainHomePageNoteView.swift
//  FrameProduct
//
//  Created by delegate on 2025/10/20.
//

import UIKit

class MainHomePageNoteView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
        
    }
    private func setupUI() {
        addSubviews(bgImageView)
        bgImageView.addSubviews(noteIconImageView, titleLabel, arrowIconImageView)
        bgImageView.snp.makeConstraints { make in
            make.left.equalTo(67)
            make.right.equalTo(-67)
            make.top.equalToSuperview()
            make.height.equalTo(60)
            make.bottom.equalToSuperview()
        }
        noteIconImageView.snp.makeConstraints { make in
            make.left.equalTo(40)
            make.centerY.equalToSuperview()
            make.width.equalTo(38)
            make.height.equalTo(24)
        }
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(noteIconImageView.snp.right).offset(12)
            make.centerY.equalToSuperview()
        }
        arrowIconImageView.snp.makeConstraints { make in
            make.right.equalTo(-30)
            make.centerY.equalToSuperview()
            make.width.equalTo(32)
            make.height.equalTo(32)
        }
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func set(noteIconImageView iconStr: String, titleLabel str: String) {
        noteIconImageView.image = UIImage(named: iconStr)
        titleLabel.text = str
    }
    //=================================================================
    //                            lazy
    //=================================================================
    // MARK: - lazy
    private lazy var bgImageView: UIImageView = {
        let imageView = UIImageView(frame: .zero)
        imageView.image = UIImage(named: "home_node_show_bg_img")
        imageView.isUserInteractionEnabled = true
        return imageView
    }()
    private lazy var noteIconImageView: UIImageView = {
        let imageView = UIImageView(frame: .zero)
        return imageView
    }()
    private lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.text = "日本"
        label.textColor = .lxs.hex("#CCCCCC")
        label.font = .lxs.font(size: 14)
        return label
    }()
    private lazy var arrowIconImageView: UIImageView = {
        let imageView = UIImageView(frame: .zero)
        imageView.image = UIImage(named: "home_note_arrow_icon")
        return imageView
    }()
}
